<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			
			 
			var sum = 0;
			for(var i = 1 ; i <= 100; i++){
				sum += i;
			}
			document.writeln("1~100以内的和为："+ sum+"<br />");
			
			
			var max;
			    var p=[2,8,21,74,28,99];
			    for( var i=0;i<p.length-1;i++){
			      if(p[i]>p[i+1]){
			      max=p[i];
			      }
			      else{
			        max=p[i+1];
			      }
			    }
			document.write(max);
		</script>
	</body>
</html>
